package com.starblink.login.deleteyouraccount.ui

import com.alibaba.android.arouter.facade.annotation.Route
import com.starblink.basic.route.RoutePage
import android.os.Bundle
import android.text.method.ScrollingMovementMethod
import com.starblink.android.basic.base.activity.BaseTVMActivity
import com.starblink.android.basic.ext.click
import com.starblink.android.basic.extension.navigation
import com.starblink.basic.style.title.OnTitleBarListener
import com.starblink.basic.style.title.TitleBar
import com.starblink.login.databinding.ActivityDeleteYourAccountBinding

@Route(path = RoutePage.Login.DELETE_YOUR_ACCOUNT)
class DeleteYourAccountActivity :
    BaseTVMActivity<ActivityDeleteYourAccountBinding, DeleteYourAccountVM>() {

    override fun initViewBinding(): ActivityDeleteYourAccountBinding =
        ActivityDeleteYourAccountBinding.inflate(layoutInflater)

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)

        viewBinding.titleBar.setOnTitleBarListener(object : OnTitleBarListener {
            override fun onLeftClick(titleBar: TitleBar?) {
                finish()
            }
        })

        //如果某手机屏幕过小 让textview可滚动
        viewBinding.adyaDesc.movementMethod = ScrollingMovementMethod.getInstance()

        viewBinding.adyaConfirmBtn.click {
            navigation(path = RoutePage.Login.DELETION_CONFIRM)
        }

        viewBinding.adyaCancel.click {
            finish()
        }

    }

}